import { Layout, Menu, Tabs } from "antd";
import {  BrowserRouter as Router, Route, Link,Switch } from "react-router-dom"
import React from "react";
import {StudentView} from './StudentView'
import {SessionView} from './SessionView'
import {TeacherView} from './TeacherView'
import "./mainview.css";

const { Header, Content, Footer } = Layout;
const { TabPane } = Tabs;
export class MainView extends React.Component<any, any> {
    render() {
        return (
            <Router>
                <Layout className="layout">
                    <Header>
                        <div className="logo" />
                        <Menu theme="dark" mode="horizontal" defaultSelectedKeys={["1"]}>
                            <Menu.Item key={1}>
                                <Link to="/session">课程</Link>
                            </Menu.Item>
                            <Menu.Item key={2}>
                                <Link to="/teacher">老师</Link>
                            </Menu.Item>
                            <Menu.Item key={3}>
                                <Link to="/student">学生</Link>
                            </Menu.Item>
                        </Menu>
                    </Header>
                    <Content style={{ padding: "50px 50px 0 50px" }}>
                        <Switch>
                            <Route path="/session">
                                <SessionView/>
                            </Route>
                            <Route path="/teacher">
                                <TeacherView/>
                            </Route>
                            <Route path="/student">
                                <StudentView/>
                            </Route>
                        </Switch>
                    </Content>
                    <Footer style={{ textAlign: "center" }}>
                        Ant Design ©2018 Created by Ant UED
                    </Footer>
                </Layout>
            </Router>
        );
    }
}
